package com.google.code.sharecontent.dao.impl;

import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.SQLException;

import com.google.code.sharecontent.dao.ContentsArtistsViewDao;
import com.google.code.sharecontent.model.ContentsArtistsView;

public class ContentsArtistsViewDaoImpl extends BaseViewDaoImpl<ContentsArtistsView> implements ContentsArtistsViewDao {

	public ContentsArtistsViewDaoImpl(Connection connection) {
		super(connection);
	}

	@Override
	public ContentsArtistsView createByRow(ResultSet rs) throws SQLException {
		ContentsArtistsView contentsArtistsView = new ContentsArtistsView();
		contentsArtistsView.setArtist(rs.getString("ARTIST"));
		contentsArtistsView.setKol(rs.getInt("KOL"));
		return contentsArtistsView;
	}

	@Override
	protected String getTableName() {
		return "CONTENTS_ARTISTS_VIEW";
	}
}
